<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>first</title>
  <!--

    http://www.ourd3js.com/wordpress/396/

  -->
</head>
<body>
  <p class="vi">就是这样</p>
  <p class="vi">就是这样</p>
  <p class="vi">就是这样</p>
  <p class="vi">就是那样</p>

  <script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
  <script>
    var p = d3.select('body').selectAll('p').text('hello wall');
    p.style('font-size', '12px');

    // datum()
    p.datum('wei');
    p.text(function(d, i) {
      return '第' + i + '个数据为：' + d
    })

    // data
    var dataset = ["I like dogs", "I like cats", "I like snakes"];
    p.data(dataset).text(function(d, i) {
      return d
    })


    // append 添加 insert() 前面添加  remove 删除
    d3.select('body').append("p")
        .text("append p element");
  </script>
</body>
</html>
